package com.dongbao.util;

import com.intellij.codeInsight.completion.util.PsiTypeCanonicalLookupElement;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiClassType;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiField;

import java.util.ArrayList;
import java.util.List;

public class FieldUtil {

    public static PsiClass getFieldClass(PsiField field) {
        return new PsiTypeCanonicalLookupElement(field.getType()).getPsiClass();
    }

    /**
     * 判断声明的字段是否是接口类型引入
     * */
    public static Boolean checkFieldIsInterface(PsiField field){
        final PsiClassType operandClassType = (PsiClassType)field.getType();
        PsiClass resolve = operandClassType.resolve();
        boolean isInterface = resolve.isInterface();
        return isInterface;
    }


}
